package com.dudu.service.impl;

import java.util.List;

import com.dudu.dao.BillDao;
import com.dudu.dao.PayCardDao;
import com.dudu.service.IPay;

import core.CoreDao;
import core.CoreDaoInvoke;
import net.sf.json.JSONObject;

public class PayServiceImpl implements IPay {
	
	private PayCardDao dao=new PayCardDao();
	
	private BillDao billDao = new BillDao();
	
	private static CoreDao coreDao = CoreDaoInvoke.getInstance();

	@Override
	public JSONObject queryPayCardInfo(String app_key) {
		//1、先判断t_app_cardpay表是否有数据
		List<JSONObject> list = billDao.queryAppCardpay(coreDao, app_key);
		if(list.size() == 0){
			billDao.insertAppCardpay(coreDao, app_key);
		}
		return dao.queryCardPayInfoByAppKey(coreDao, app_key);
	}

}
